package com.workpaper.app.workpaper.daily.view.listener;

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;

import com.workpaper.app.workpaper.daily.business.DailyWorkpaperBusiness;
import com.workpaper.app.workpaper.daily.entity.DailyWorkpaper;
import com.workpaper.app.workpaper.daily.view.DailyWorkpaperInfoDialog;

public class ShowDailyWorkpaperListener implements SelectionListener{

	@Override
	public void widgetSelected(SelectionEvent e) {
		Button btn = (Button) e.widget;
		String id = (String) btn.getData();
//		WorkpaperDailyViewConsts
		DailyWorkpaperBusiness business = DailyWorkpaperBusiness.getInstance();
		DailyWorkpaper dailyWorkpaper = business.selectById(id);
		new DailyWorkpaperInfoDialog(null, dailyWorkpaper).open();
	
	}

	@Override
	public void widgetDefaultSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		
	}
	
}
